import {Dispatcher} from "adajs";

class SocketDispatcher extends Dispatcher {
	constructor() {
		super();
		let socket = io.connect(`${window.location.protocol}//${window.location.host.split(":")[0]}:3000`);
		socket.on('status', data => {
			this.dispatch("status", data);
		});
	}
}

let socket = new SocketDispatcher();

export default socket;